import {createRouter, createWebHashHistory, createMemoryHistory} from "vue-router";

const router =  createRouter({
    routes:[
        {path: '/', redirect: '/home'},
        {name: 'login', path: '/login', component: ()=>import('./views/Login.vue'), meta: {title: '登录'}},
        {name: 'home', path: '/home', component: ()=>import('./views/Home.vue'),
            meta: {title: '主页'}
        },
    ],
    history: createWebHashHistory()
})
const rootTitle = '东软环保公众监督平台决策者端'
router.afterEach((to, next)=>{
    // @ts-ignore
    document.querySelector('title').innerText = rootTitle + '-' + to.meta.title
})

export default router
